package mythink_1;

import java.util.Date;
public class Account {
	
	public static class account{
		private int id = 0;  //编号
		private double balance = 0;//余额
		private double rate = 0; //保存利率
		private Date accountDate = new Date();
		
		
		public Date getAccountDate() {
			return accountDate;
		}
		public void setAccountDate(Date accountDate) {
			this.accountDate = accountDate;
		}
		public int getId() {
			return id;
		}
		public void setId(int id) {
			this.id = id;
		}
		public double getBalance() {
			return balance;
		}
		public void setBalance(double balance) {
			this.balance = balance;
		}
		public double getRate() {
			return rate;
		}
		public void setRate(double rate) {
			this.rate = rate;
		}
		public account() {  //无参构造
			super();
		}
		public account(int id, double balance) {  //有参构造
			super();
			this.id = id;
			this.balance = balance;
		}
		
		double getRate1(double rate){
			this.balance = this.balance*(1+rate);
			return this.balance;
		}
		void draw(double withdraw){ //取出
			if(this.balance >= withdraw) {
				this.balance = this.balance-withdraw;
				System.out.println("取出后余额:"+this.balance);
			}
			else
				System.out.println("余额不足，不可以取钱！！！");
		}
		void pus(double deposit) { //存入
			this.balance = this.balance+deposit;
			System.out.println("存入后余额："+this.balance);
		}
	}	
}
